package com.sslpay.merchant.convert;

import com.sslpay.merchant.api.dto.MerchantDTO;
import com.sslpay.merchant.entity.Merchant;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 描述：商户DTO和商户实体转换器
 *
 * @author ssl
 * @create 2020/04/15 16:17
 */
@Mapper
public interface MerchantConvert {
    MerchantConvert INSTANCE = Mappers.getMapper(MerchantConvert.class);

    /**
     * 商户DTO转ENTITY
     *
     * @param dto
     * @return
     */
    Merchant dtoToEntity(MerchantDTO dto);

    /**
     * 商户ENTITY转DTO
     *
     * @param merchant
     * @return
     */
    MerchantDTO entityToDTO(Merchant merchant);

    /**
     * 商户ENTITY转DTO
     *
     * @param merchants
     * @return
     */
    List<MerchantDTO> entityListToDTOList(List<Merchant> merchants);

}
